package com.tiny.model;

import java.util.ArrayList;
import java.util.List;

import com.jfinal.plugin.activerecord.Model;

public class MenuPermission extends Model<MenuPermission>{

	private static final long serialVersionUID = 5721481570867001053L;

	public static final MenuPermission dao = new MenuPermission();
	
	public Integer PermissionId() {
		return this.getInt("permission_id");
	}
	
	public List<Integer> selectPermissionIdSet(int id) {
		List<Integer> ls=new ArrayList<Integer>();
		List<MenuPermission> menuPermissions=MenuPermission.dao.find(" select * from menupermission where menu_id =? ",id);
		
        for(MenuPermission mp:menuPermissions){
        	ls.add(mp.PermissionId());
        }
        return ls;
    }
	
}
